/**
 * 案件处理, 承办中心
 */

import axios from "@/utils/axios";

// 回退案件(针对调查中的案件)
export const appeal = (data) =>
  axios({
    url: "/api/v1/workOrder/process/appeal",
    method: "POST",
    data,
  });
// 取消回退案件(针对回退中的案件)
export const cancelAppeal = (workOrderNo) =>
  axios({
    url: `/api/v1/workOrder/process/cancelappeal/${workOrderNo}`,
    method: "POST",
  });
// 取消办结案件(针对已处理的案件)
export const cancelFinishProcess = (workOrderNo) =>
  axios({
    url: `/api/v1/workOrder/process/cancelfinishprocess/${workOrderNo}`,
    method: "POST",
  });

// 详情(我的案件页面使用)
export const detail = (id) =>
  axios({
    url: `/api/v1/workOrder/process/detail/${id}`,
    method: "GET",
  });
// 列表
export const list = (params) =>
  axios({
    url: "/api/v1/workOrder/process/list",
    method: "GET",
    params,
  });
// 开始处理案件(针对调查中的案件)
export const start = (workOrderNo) =>
  axios({
    url: `/api/v1/workOrder/process/start/${workOrderNo}`,
    method: "POST",
  });
// 流程详情
export const processDetails = (id) =>
  axios({
    url: `/api/v1/workOrder/process/process/${id}`,
    method: "GET",
  });

// 办结案件(针对处理中的案件)
export const finishProcess = (data) =>
  axios({
    url: "/api/v1/workOrder/process/finishprocess",
    method: "POST",
    data,
  });

// 中止案件(针对处理中的案件)
export const stop = (data) =>
  axios({
    url: "/api/v1/workOrder/process/stop",
    method: "POST",
    data,
  });

// 延期案件(针对处理中的案件)
export const addtime = (data) =>
  axios({
    url: "/api/v1/workOrder/process/addtime",
    method: "POST",
    data,
  });

// 继续处理（针对已中止的案件）
export const continueProcess = (workOrderNo) =>
  axios({
    url: `/api/v1/workOrder/process/continueprocess/${workOrderNo}`,
    method: "POST",
  });

// 终止案件(针对处理中的案件)
export const over = (data) =>
  axios({
    url: "/api/v1/workOrder/process/over",
    method: "POST",
    data,
  });

// 取消终止（针对已终止的案件）
export const cancelOver = (workOrderNo) =>
  axios({
    url: `/api/v1/workOrder/process/cancelover/${workOrderNo}`,
    method: "POST",
  });

// 取消确认案件(针对已确认的案件)
export const cancelconfirmation = (workOrderNo) =>
  axios({
    url: `/api/v1/workOrder/process/cancelconfirmation/${workOrderNo}`,
    method: "POST",
  });

// 上传补正材料
export const addAttachment = (data) =>
  axios({
    url: "/api/v1/workOrder/process/addattachment",
    method: "POST",
    data,
  });

export const addSupervision = (data) =>
  axios({
    url: "api/v1/workOrder/supervision/addSupervision",
    method: "POST",
    data,
  });

export const cancelSupervision = (data) =>
  axios({
    url: "api/v1/workOrder/supervision/cancelSupervision",
    method: "POST",
    data,
  });
// 添加异常
export const addException = (data) =>
  axios({
    url: "api/v1/workOrder/supervision/addException",
    method: "POST",
    data,
  });

// 编辑跟踪
export const editSupervision = (data) =>
  axios({
    url: "api/v1/workOrder/supervision/editSupervision",
    method: "POST",
    data,
  });

// 编辑异常
export const editException = (data) =>
  axios({
    url: "api/v1/workOrder/supervision/editException",
    method: "POST",
    data,
  });

// 复核审批(针对复核中的工单)
export const doRepeatCheck = (data) =>
  axios({
    url: "api/v1/workOrder/process/doRepeatCheck",
    method: "POST",
    data,
  });

// 确认退回
export const makeSureReturn = (data) =>
  axios({
    url: "/api/v1/workOrder/distribute/makeSureReturn",
    method: "POST",
    data,
  });
